// 1. 导入fs模块
const fs = require('fs');

const path = require('path');

let url = path.resolve(__dirname,'../视频/01-迭代器回顾.mp4');
console.log(url);

// 文件流式读取对象 - 
let rs = fs.createReadStream(url);

// 文件流式写入对象
let ws = fs.createWriteStream('./1.mp4');


// 读取数据 固定写法，
rs.on('data',(chunk)=>{
    console.log(chunk);

    ws.write(chunk);
})
